import { createApp } from 'vue'
import { createRouter, createWebHistory } from "vue-router";
import App from './App.vue'

import LoginForm from './components/LoginForm.vue'
import RegisterForm from './components/RegisterForm.vue'
import ArticleCom from './components/ArticleCom.vue'

const routes = [
    { path: '/', component: LoginForm },
    { path: '/articleCom', component: ArticleCom },
    { path: '/login', component: LoginForm },
    { path: '/register', component: RegisterForm },
  ]

const router = createRouter({
    // 4. 内部提供了 history 模式的实现。为了简单起见，我们在这里使用 hash 模式。
    history: createWebHistory(),
    routes, // `routes: routes` 的缩写
  })

const app = createApp(App);

//整个应用支持路由。
app.use(router)

app.mount('#app')
